<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8">
<title>APK管理|升级包</title>
<@fm.header />
<style>
.provinceClass label {
	font-size: 12px;
	float:left;
	margin:2px;
	width:80px;
	height:20px;
}
</style>
</head>
<body>
<div class="easyui-layout" style="text-align: center; height: 270px;" fit="true">
	<div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
	<form id="ff" method="post" enctype="multipart/form-data">
	    <table>
	        <tr>
	            <td><label for="marketplace">应用市场:</label></td>
	            <td><input class="easyui-validatebox" type="text" name="marketplace" value="" ></input>
	        </tr>
	         <tr>
	            <td><label for="num">每分钟下发量:</label></td>
	            <td><input class="easyui-validatebox" type="text" name="num" value="" ></input>
	        </tr>
	        <tr>
	            <td><label for="apkUpload">apk:</label></td>
	            <td colspan=3>
	            	<input type="file" name="file" id="apk"></input>
	            	<input id="apkPath" type="text" readonly="readonly" style="width:200px" name="apkPath" value="" ></input>
	            </td>
	        </tr>
	    </table>
	    <input type="hidden" id="ids" name="ids" value="${ids}">
	</form>
	</div>
	<div region="south" border="false" style="text-align: center; padding: 5px 5px 5px 0;">
	    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="edit()">提交</a>
	</div>
</div>

<script>
function edit() {
	
	$('#ff').form(
	    'submit',
	    {
			url : '/apkconfig/upgradeApk',
			onSubmit : function() {
				return $(this).form('enableValidation').form('validate');
			},
			success : function(data) {
				showProcess(false);
				var data = eval('(' + data + ')');
				if (data.return_code == '1') {
					top.showMsg(market.content.title, data.return_msg, alert);
					if (parent !== undefined) {
						if ($.isFunction(parent.reloadParent)) {
							parent.reloadParent.call();
							parent.closeMyWindow();
						} else {
							parent.$("#tt").datagrid('reload');
							parent.closeMyWindow();
						}
					}
				}else if(data.return_code == '10'){
					$.messager.alert(market.content.title, data.return_msg);
					if (parent !== undefined) {
						if ($.isFunction(parent.reloadParent)) {
							parent.reloadParent.call();
							parent.closeMyWindow();
						} else {
							parent.$("#tt").datagrid('reload');
							parent.closeMyWindow();
						}
					}
				} else {
					$.messager.alert(market.content.title, data.return_msg);
				}
			},
			onLoadError : function() {
				showProcess(false);
				$.messager.alert(market.content.title, market.content.networkError);
			}
		}); 
}
</script>
</body>
</html>